package com.znow.admin.system.security.model.convert;

import com.znow.admin.dao.entity.sys.SysUserEntity;
import com.znow.admin.system.security.model.dto.SysUserDetailsDTO;
import com.znow.admin.system.security.model.res.user.UserRequest;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * 系统用户dtoconvert
 *
 * @author Nemo
 * @date 2022/10/21
 */
@Mapper
public interface SysUserConvert {

    SysUserConvert INSTANCE = Mappers.getMapper(SysUserConvert.class);

    /**
     * 用户dto
     *
     * @param entity 实体
     * @return {@link SysUserDetailsDTO}
     */
    SysUserDetailsDTO toUserDTO(SysUserEntity entity);

    /**
     * 转换用户实体添加用户请求
     *
     * @param request 请求
     * @return {@link SysUserEntity}
     */
    SysUserEntity convertUserEntityWithAddUserRequest(UserRequest request);
}
